<?php 
namespace Marketing\Model\Entity;

use Zend\InputFilter\Factory as InputFactory;     // <-- Add this import
use Zend\InputFilter\InputFilter;                 // <-- Add this import
use Zend\InputFilter\InputFilterAwareInterface;   // <-- Add this import
use Zend\InputFilter\InputFilterInterface;        // <-- Add this import

class Marketinglist {
	public $id;
	public $name;
	public $description;
	public $fromname;
	public $fromaddress;
	public $anyonecansubscribe;
	public $ownedsecurableitem_id;


	public function exchangeArray($data)
	{
		//$this->id     = (isset($data['id'])) ? $data['id'] : null;
		$this->name = (isset($data['name'])) ? $data['name'] : null;
		$this->description  = (isset($data['description'])) ? $data['description'] : null;
		$this->fromname  = (isset($data['fromname'])) ? $data['fromname'] : null;
		$this->fromaddress  = (isset($data['fromaddress'])) ? $data['fromaddress'] : null;
		$this->anyonecansubscribe  = (isset($data['anyonecansubscribe'])) ? $data['anyonecansubscribe'] : null;
		$this->ownedsecurableitem_id  = (isset($data['ownedsecurableitem_id'])) ? $data['ownedsecurableitem_id'] : null;
	}
	
public function __construct(array $options = null) {
        if (is_array($options)) {
            $this->setOptions($options);
        }
    }

    public function setOptions(array $options) {
        $methods = get_class_methods($this);
        foreach ($options as $key => $value) {
            $method = 'set' . ucfirst($key);
            if (in_array($method, $methods)) {
                $this->$method($value);
            }
        }
        return $this;
    }
    
    
    protected $inputFilter;
    
    public function setInputFilter(InputFilterInterface $inputFilter)
    {
    	throw new \Exception("Not used");
    }
    
    public function getInputFilter()
    {
    	if (!$this->inputFilter)
    	{
    		$inputFilter = new InputFilter();
    		$factory = new InputFactory();
    
    
    		$inputFilter->add($factory->createInput(array(
    				'name' => 'name',
    				'required' => true,
    				'filters' => array(
    						array('name' => 'StripTags'),
    						array('name' => 'StringTrim'),
    				),
    				 
    		)));
    
    		$inputFilter->add($factory->createInput(array(
    				'name' => 'description',
    				'required' => true,
    				'filters' => array(
    						array('name' => 'StripTags'),
    						array('name' => 'StringTrim'),
    				),
    
    		)));
    
    		$inputFilter->add($factory->createInput(array(
    				'name' => 'fromname',
    				'required' => true,
    				'filters' => array(
    						array('name' => 'StripTags'),
    						array('name' => 'StringTrim'),
    				),
    
    		)));
    
    		$inputFilter->add($factory->createInput(array(
    				'name' => 'fromaddress',
    				'required' => true,
    				'filters' => array(
    						array('name' => 'StripTags'),
    						array('name' => 'StringTrim'),
    				),
    
    		)));
    
    		$inputFilter->add($factory->createInput(array(
    				'name' => 'anyonecansubscribe',
    				'required' => true,
    				'filters' => array(
    						array('name' => 'StripTags'),
    						array('name' => 'StringTrim'),
    				),
    
    		)));
    
    		$inputFilter->add($factory->createInput(array(
    				'name' => 'ownedsecurableitem_id',
    				'required' => true,
    				'filters' => array(
    						array('name' => 'StripTags'),
    						array('name' => 'StringTrim'),
    				),
    
    		)));
    
    		
    		$this->inputFilter = $inputFilter;
    	}
    
    	return $this->inputFilter;
    }

    public function getId() {
        return $this->id;
    }

    public function setId($id) {
        $this->id = $id;
        return $this;
    }
    
    public function getName() {
    	return $this->name;
    }
    
    public function setName($name) {
    	$this->name = $name;
    	return $this;
    }
    
    public function getDescription() {
    	return $this->description;
    }
    
    public function setDescription($description) {
    	$this->description = $description;
    	return $this;
    }
    
    public function getFromName() {
    	return $this->fromname;
    }
    
    public function setFromName($fromname) {
    	$this->fromname = $fromname;
    	return $this;
    }
    
    public function getFromAddress() {
    	return $this->fromaddress;
    }
    
    public function setFromAddress($fromaddress) {
    	$this->fromaddress = $fromaddress;
    	return $this;
    }
    
    public function getAnyoneCanSubscribe() {
    	return $this->anyonecansubscribe;
    }
    
    public function setAnyoneCanSubscribe($anyonecansubscribe) {
    	$this->anyonecansubscribe = $anyonecansubscribe;
    	return $this;
    }
    
    public function getOwnedSecurableitem_id() {
    	return $this->ownedsecurableitem_id;
    }
    
    public function setOwnedSecurableitem_id($ownedsecurableitem_id) {
    	$this->ownedsecurableitem_id = $ownedsecurableitem_id;
    	return $this;
    }
}
?>